#ifndef DRAW3D_TEST_H
#define DRAW3D_TEST_H

#include <QtWidgets/QWidget>
#include<QOpenGLWidget>
#include "ui_draw3d_test.h"
#include <QList>
#include <surface.h>
#include "Mover.h"
#include <QMediaPlayer>
#include <QMutex>
#include <thread>
#include "surface.h"
GEO_ALG_USE_NAMESPACE

#define BaseWidget QWidget
class draw3d_test : public BaseWidget {
    Q_OBJECT

public:
    draw3d_test(QWidget* parent = 0);
    ~draw3d_test();

    virtual void paintEvent(QPaintEvent* event);

    virtual void keyPressEvent(QKeyEvent* event);
signals:
    void sig_play_xiu();
    void sig_play_tong();
public slots:
    void emittter();
    void update_mover();
    void update_draw();
    void st_play_xiu();
    void st_play_boom();
private:
    Ui::draw3d_testClass ui;

    QList<Surface> proj_faces_;
    MultiSurface msf_;

    Plane3d view_;

    QList<LineSegment3d> dotted_lines_;
    QList<LineSegment3d> solid_lines_;

    QMediaPlayer player1_, player2_, player3_;
    QList<Mover*> fireworks_list_;
    QMutex mutext_;
    std::thread     update_thread_;
    bool    exit_ = false;
    double degree_ = 0;
};

#endif // DRAW3D_TEST_H
